package com.hellloweb.mainactivity;

import android.content.Context;
import android.os.Bundle;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;

public class TextViewFragment extends Fragment {
    //当Fragment被加载
    @Override
    public void onAttach(@NonNull Context context) {
        super.onAttach(context);
        Log.d("TextViewFragment", "onAttach: ");
    }
    //当Fragment被初始化
    @Override
    public void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        Log.d("TextViewFragment", "onCreate: ");
    }
    //当fragment被加载界面时
    @Nullable
    @Override
    public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
       // return super.onCreateView(inflater, container, savedInstanceState);
        View view = inflater.inflate(R.layout.fragment_textview,container,false);
        Log.d("TextViewFragment", "onCreateView: ");
        return view;
    }
    //当Activity完成所有frament的加载时
    @Override
    public void onActivityCreated(@Nullable Bundle savedInstanceState) {
        super.onActivityCreated(savedInstanceState);
        Log.d("TextViewFragment", "onActivityCreated: ");
    }
}
